﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>费用报销报表</title>
    <link href="../../Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <script src="../../Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="../../Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="../../Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="../../Content/themes/icon.css" rel="stylesheet" />
    <link href="../../Content/themes/table.css" rel="stylesheet" />
    <link href="../../Content/formstyles.css" rel="stylesheet" />
    <script src="../../Content/js/common.js"></script>
   
</head>
<body>
    <div id="ui_main_layout" class="easyui-layout" data-options="fit:true,border:false">
        <div data-options="region:'north',split:true,border:true,collapsed:false" title="条件搜索" style="height:104px;">
            <div id="ui_main_search">
                <div>
                    <input class="easyui-combobox" id="s-group" data-options="editable:false,width:200,
                                 label:'分组方法：',labelPosition:'before',labelAlign:'right',
                                   valueField: 'value', textField: 'label',value:'dept',data: [
                                   {    label: '按部门',
			                            value: 'dept'
		                            },{
			                            label: '按项目',
			                            value: 'projectNo'
		                            },]" />
                    <input class="easyui-combobox" id="s-status" data-options="editable:false,width:200,
                                 label:'单据状态：',labelPosition:'before',labelAlign:'right',
                                   valueField: 'value', textField: 'label',value:'all',data: [
                                   {    label: '全部',
			                            value: 'all'
		                            },{
			                            label: '待审核',
			                            value: '0'
		                            },{
			                            label: '已审核',
			                            value: '1'
		                            },]" />
                    <input class="easyui-combobox" id="s-period" name="period" data-options="editable:false, width:200,
                                    label:'财务期间：',labelPosition:'before',labelAlign:'right',value:'全部',
                               valueField: 'InfoName', textField: 'InfoName',url: '/Common/SelectBasicInfo?p=815' ">
                </div>
                <div>
                    <input class="easyui-combobox" id="s-periodType" data-options="editable:false,width:200,
                                 label:'期间类型：',labelPosition:'before',labelAlign:'right',value:'claimTime',
                                   valueField: 'value', textField: 'label',data: [
                                   {    label: '报账时间',
			                            value: 'claimTime'
		                            },{
			                            label: '报账期间',
			                            value: 'claimPeriod'
		                            },]" />
                
                <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
   onclick="ui_main_searchdata();">生成报表</a>
                    <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
                       onclick="ui_main_exportdata();">导出报表</a>
            </div>
        </div>     
    </div>
        <div data-options="region:'center',border:false">
    <table id="ui_main_dg" data-options="fit:true,border:false"></table>
</div>
    <script type="text/javascript">
        $(function () {


        });
        function ui_main_searchdata() {

            $("#ui_main_dg").datagrid({       //初始化datagrid
                url: "/Financial/getExpenseRpt?r=" + Math.random(),
                queryParams: {
                    "grouptype": $("#s-group").val(),
                    "status": $("#s-status").val(),
                    "period": $("#s-period").val(),
                    "periodType": $("#s-periodType").val(),
                },
                columns: [[
                { field: "qijian", width: "80", title: "期间", align: 'center', rowspan: 2 },
                { field: "dept", width: "110", title: "部门", align: 'center', rowspan: 2 },
                { field: "projectNo", width: "110", title: "项目编号", align: 'center', rowspan: 2, hidden: false },
                { title: "管理费用", align: 'center', colspan: 4 },
                { title: "销售费用", align: 'center', colspan: 5 },
                { title: "财务费用", align: 'center', colspan: 1 },
                { field: "其他", width: "80", title: "其他", align: 'center', rowspan: 2, formatter: getCurrency, },
                { field: "sum", width: "80", title: "合计", align: 'center', rowspan: 2, formatter: getCurrency, },
                ], [
                { field: "管理费用办公费", width: "80", title: "办公费", align: 'center', formatter: getCurrency, },
                { field: "管理费用差旅费", width: "80", title: "差旅费", align: 'center', formatter: getCurrency, },
                { field: "管理费用招待费", width: "80", title: "招待费", align: 'center', formatter: getCurrency, },
                { field: "管理费用小计", width: "80", title: "小计", align: 'center', formatter: getCurrency, },
                { field: "销售费用办公费", width: "80", title: "办公费", align: 'center', formatter: getCurrency, },
                { field: "销售费用差旅费", width: "80", title: "差旅费", align: 'center', formatter: getCurrency, },
                { field: "销售费用招待费", width: "80", title: "招待费", align: 'center', formatter: getCurrency, },
                { field: "销售费用提成款", width: "80", title: "提成款", align: 'center', formatter: getCurrency, },
                { field: "销售费用小计", width: "80", title: "小计", align: 'center', formatter: getCurrency, },
                { field: "财务费用贴息款", width: "80", title: "贴息款", align: 'center', formatter: getCurrency, },
                ]],
                title: "报销费用报表",
                pagination: false,
                rownumbers: true,
                fitcolumns: true,
                singleSelect: true,
                // onLoadSuccess: function (data) {  }
            });
       }
        function ui_main_exportdata() {
            $.show_alert("消息", "功能待发布！");
            //$.show_warning("消息","功能待发布！")
           //$('#ui_main_search input').val('');
           //$('#ui_main_search select').val('select'); 
       }

        </Script>
</div>    
</body>
    </html>
